<?php
declare (strict_types = 1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Category extends Model
{
    //
    protected $hidden = ['update_time','delete_time'];

    /**
     * 一个分类对应多个商品
     * @return \think\model\relation\HasMany
     */
    public function goods(){
        return $this->hasMany(Goods::class,'cate_id','id');
    }

    /**
     * 一个分类对应多个品牌
     */
    public function brand(){
        return $this->hasMany(Brand::class,'cate_id','id');

    }
}
